<template>
  <b-card class="mb-2 an-main-body">
    <section>
      <b-spinner v-if="loading" variant="primary" type="grow" label="Spinning" />
      <div>
        <h4 class="title">{{ defData.title }}</h4>
        <div class="an-cont">
          <div v-html="defData.articleContent"></div>
        </div>
      </div>
    </section>
  </b-card>
</template>

<script>
import { getIsTopInfo } from "~/assets/services/api";
export default {
  data() {
    return {
      loading: false,
      defData: {
        title: "",
        articleContent: "",
      },
    };
  },
  asyncData({ app }) {
    return app.$axios.get(`/ECS/sys/article/top`, "").then((res) => {
      return { defData: res.data.result };
    });
  },
  mounted() {
    //this.anLoad();
  },
  methods: {
    async anLoad() {
      this.loading = true;
      const res = await getIsTopInfo();
      this.defData = res;
      this.loading = false;
    },
  },
};
</script>
